<html>
    <head><title>用户列表</title>
    </head>
    <style type="text/css">
        body{
            font-size: 12px;
        }
        .note{
            font-size: 11px;
        }
    </style>
    <script type="text/javascript">
        function hiddenList(){
            var vendor=document.uform.vendors;
            var users = document.uform.users;
            var v = null;
            for(var i=0; i<vendor.options.length; i++){
                if(vendor.options[i].selected == true){
                    v = vendor.options[i].value;
                    break;
                }
            }
            for(var i=0; i<users.options.length; i++){
                var e = users.options[i];
                var uv=e.value;
                if(uv.lastIndexOf(v, 0) == 0){
                    e.hidden = false;
                }else{
                    e.hidden = true;
                }
            }
        }
    </script>
    <body>
        <h2>消息推送</h2>
        <hr width="500" align="left">
        <form action="" method="POST" name="uform">
            <p><div><h3>推送消息内容:</h3></div>
                <div class="note">此处的内容直接通过 MESSAGE 发送给指定的用户。发送前确认客户端理解你输入的格式 </div>
             </p>
            <textarea rows="4" cols="60" name="msg"></textarea>
            <p><div><h3>选择用户列表:</h3></div><div class="note">按CTRL或SHIFT可多选</div></p>
            <p>厂商
            <select name="vendors">
                {% for v in vendors %}
                <option value="{{ v }}">{{ v }}</option>
                {% endfor %}
            </select>
            <input class="note" type="button" value="过滤" onClick="hiddenList()" />
            </p>
            <p>
            <select multiple="multiple" size="18" name="users" width="500" style="width: 500px">
                {% for u in users %}
                <option value="{{ u }}">{{ u }}</option>
                {% endfor %}
            </select>
            </p>
            <p>
            <input type="submit" value="提交" />
        </form>
    </body>
</html>
